package com.jk.controller;

import com.jk.pojo.UserBean;
import com.jk.service.RechargeableService;
import com.jk.service.UserService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.math.BigDecimal;

/**
 * @ClassName ConsumerOne
 * @Descripttion TODO
 * @Author DELL
 * @Date 2022/11/7 17:30
 * @Version 0.001
 */
@Component
public class ConsumerOne {

    @Autowired
    private RechargeableService rechargeableService;

    @Autowired
    private UserService userService;


    @RabbitListener(queues = "binzi")
    public void receive(String total_amount) throws IOException {


        userService.updateMoney(total_amount);

        System.out.println("消费者二收到消息："+total_amount);
    }
}
